/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.epam.javatanf2013.web.examples.servlets;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.logging.Logger;
import javax.servlet.GenericServlet;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

/**
 *
 * @author Istvan_Monori
 */
public class ExampleGenericServlet extends GenericServlet {

    @Override
    public void init() throws ServletException {
        super.init(); //To change body of generated methods, choose Tools | Templates.
        doSomething();
        this.getServletContext().setAttribute("LoadOnStartup", "test");
    }
    
    
    private void doSomething() {
        System.out.println("Hello");
        Logger log = Logger.getLogger("log");
        log.info("Hello");
    }
    
    @Override
    public void service(ServletRequest sr, ServletResponse sr1) throws ServletException, IOException {
        doSomething();
    }


}
